home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / nmedfree / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-04-20  |  9.9 KB  |  286 lines

  1. VERSION 5.00
  2. Object = "{B4178631-C6A8-11D1-89AB-08A604C10000}#1.0#0"; "NUMEDIT.OCX"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Numeric Edit Control Sample"
  6.    ClientHeight    =   3120
  7.    ClientLeft      =   45
  8.    ClientTop       =   345
  9.    ClientWidth     =   5475
  10.    ClipControls    =   0   'False
  11.    Icon            =   "Form1.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3120
  17.    ScaleWidth      =   5475
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  'CenterScreen
  20.    Begin NumEdit.NumericEdit NumericEdit1 
  21.       DataField       =   "Field1"
  22.       DataSource      =   "Data1"
  23.       Height          =   315
  24.       Left            =   885
  25.       TabIndex        =   7
  26.       Top             =   1335
  27.       Width           =   1755
  28.       _ExtentX        =   3096
  29.       _ExtentY        =   556
  30.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   8.25
  33.          Charset         =   0
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Text            =   "0"
  40.       AllowEstimates  =   -1  'True
  41.       Estimated       =   -1  'True
  42.       CalculatorPicture=   "Form1.frx":0442
  43.       CalculatorButtonStyle=   1
  44.       EstimatedSymbolForeColor=   -2147483635
  45.       BeginProperty EstimatedSymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  46.          Name            =   "MS Sans Serif"
  47.          Size            =   8.25
  48.          Charset         =   0
  49.          Weight          =   700
  50.          Underline       =   0   'False
  51.          Italic          =   0   'False
  52.          Strikethrough   =   0   'False
  53.       EndProperty
  54.    End
  55.    Begin VB.Data Data1 
  56.       Align           =   2  'Align Bottom
  57.       Caption         =   "Data1"
  58.       Connect         =   "Access"
  59.       DatabaseName    =   "D:\Projects\PDSoftware\CONTROLS\NumEdit\Test\test.mdb"
  60.       DefaultCursorType=   0  'DefaultCursor
  61.       DefaultType     =   2  'UseODBC
  62.       Exclusive       =   0   'False
  63.       Height          =   345
  64.       Left            =   0
  65.       Options         =   0
  66.       ReadOnly        =   0   'False
  67.       RecordsetType   =   1  'Dynaset
  68.       RecordSource    =   "Table1"
  69.       Top             =   2775
  70.       Width           =   5475
  71.    End
  72.    Begin VB.CommandButton Command1 
  73.       Caption         =   "&Close"
  74.       Height          =   360
  75.       Left            =   4260
  76.       TabIndex        =   4
  77.       Top             =   2295
  78.       Width           =   1110
  79.    End
  80.    Begin NumEdit.NumericEdit NumericEdit2 
  81.       DataField       =   "Field2"
  82.       DataSource      =   "Data1"
  83.       Height          =   315
  84.       Left            =   885
  85.       TabIndex        =   8
  86.       Top             =   1785
  87.       Width           =   1755
  88.       _ExtentX        =   3096
  89.       _ExtentY        =   556
  90.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  91.          Name            =   "MS Sans Serif"
  92.          Size            =   8.25
  93.          Charset         =   0
  94.          Weight          =   400
  95.          Underline       =   0   'False
  96.          Italic          =   0   'False
  97.          Strikethrough   =   0   'False
  98.       EndProperty
  99.       Text            =   "0.00E+00"
  100.       AllowEstimates  =   -1  'True
  101.       Estimated       =   -1  'True
  102.       Format          =   5
  103.       CalculatorPicture=   "Form1.frx":1AD4
  104.       BorderStyle     =   0
  105.       EstimatedSymbolForeColor=   255
  106.       ButtonStyle     =   2
  107.       BeginProperty EstimatedSymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  108.          Name            =   "MS Sans Serif"
  109.          Size            =   8.25
  110.          Charset         =   0
  111.          Weight          =   700
  112.          Underline       =   0   'False
  113.          Italic          =   0   'False
  114.          Strikethrough   =   0   'False
  115.       EndProperty
  116.    End
  117.    Begin NumEdit.NumericEdit NumericEdit3 
  118.       DataField       =   "Field3"
  119.       DataSource      =   "Data1"
  120.       Height          =   315
  121.       Left            =   3615
  122.       TabIndex        =   9
  123.       Top             =   1335
  124.       Width           =   1755
  125.       _ExtentX        =   3096
  126.       _ExtentY        =   556
  127.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  128.          Name            =   "MS Sans Serif"
  129.          Size            =   8.25
  130.          Charset         =   0
  131.          Weight          =   400
  132.          Underline       =   0   'False
  133.          Italic          =   0   'False
  134.          Strikethrough   =   0   'False
  135.       EndProperty
  136.       Text            =   "
  137. 0.00"
  138.       AllowEstimates  =   -1  'True
  139.       Estimated       =   -1  'True
  140.       EstimatedSymbol =   "e"
  141.       Format          =   1
  142.       CalculatorBackColor=   -2147483626
  143.       CalculatorPicture=   "Form1.frx":3166
  144.       CalculatorButtonStyle=   4
  145.       CalculatorBorderStyle=   1
  146.       BorderStyle     =   1
  147.       EstimatedSymbolForeColor=   32768
  148.       ButtonBackColor =   -2147483632
  149.       ButtonStyle     =   4
  150.       ButtonForecolor =   -2147483630
  151.       ButtonHighlightColor=   -2147483634
  152.       BeginProperty EstimatedSymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  153.          Name            =   "MS Sans Serif"
  154.          Size            =   8.25
  155.          Charset         =   0
  156.          Weight          =   700
  157.          Underline       =   0   'False
  158.          Italic          =   0   'False
  159.          Strikethrough   =   0   'False
  160.       EndProperty
  161.    End
  162.    Begin NumEdit.NumericEdit NumericEdit4 
  163.       DataField       =   "Field4"
  164.       DataSource      =   "Data1"
  165.       Height          =   315
  166.       Left            =   3615
  167.       TabIndex        =   10
  168.       Top             =   1785
  169.       Width           =   1755
  170.       _ExtentX        =   3096
  171.       _ExtentY        =   556
  172.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  173.          Name            =   "MS Sans Serif"
  174.          Size            =   8.25
  175.          Charset         =   0
  176.          Weight          =   400
  177.          Underline       =   0   'False
  178.          Italic          =   0   'False
  179.          Strikethrough   =   0   'False
  180.       EndProperty
  181.       Text            =   "0.00%"
  182.       AllowEstimates  =   -1  'True
  183.       Format          =   4
  184.       CalculatorPicture=   "Form1.frx":47F8
  185.       CalculatorButtonStyle=   3
  186.       BorderStyle     =   1
  187.       EstimatedSymbolForeColor=   -2147483635
  188.       ButtonStyle     =   3
  189.       BeginProperty EstimatedSymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  190.          Name            =   "MS Sans Serif"
  191.          Size            =   8.25
  192.          Charset         =   0
  193.          Weight          =   400
  194.          Underline       =   0   'False
  195.          Italic          =   0   'False
  196.          Strikethrough   =   0   'False
  197.       EndProperty
  198.    End
  199.    Begin VB.Label Label2 
  200.       AutoSize        =   -1  'True
  201.       Caption         =   "&Scientific:"
  202.       Height          =   195
  203.       Index           =   3
  204.       Left            =   120
  205.       TabIndex        =   6
  206.       Top             =   1815
  207.       Width           =   690
  208.    End
  209.    Begin VB.Label Label2 
  210.       AutoSize        =   -1  'True
  211.       Caption         =   "&Percent:"
  212.       Height          =   195
  213.       Index           =   2
  214.       Left            =   2805
  215.       TabIndex        =   5
  216.       Top             =   1815
  217.       Width           =   600
  218.    End
  219.    Begin VB.Label Label2 
  220.       AutoSize        =   -1  'True
  221.       Caption         =   "&Currency:"
  222.       Height          =   195
  223.       Index           =   1
  224.       Left            =   2805
  225.       TabIndex        =   3
  226.       Top             =   1380
  227.       Width           =   675
  228.    End
  229.    Begin VB.Label Label2 
  230.       AutoSize        =   -1  'True
  231.       Caption         =   "&General:"
  232.       Height          =   195
  233.       Index           =   0
  234.       Left            =   120
  235.       TabIndex        =   0
  236.       Top             =   1380
  237.       Width           =   600
  238.    End
  239.    Begin VB.Label Label1 
  240.       AutoSize        =   -1  'True
  241.       Caption         =   $"Form1.frx":5E8A
  242.       Height          =   585
  243.       Index           =   1
  244.       Left            =   90
  245.       TabIndex        =   2
  246.       Top             =   555
  247.       Width           =   5490
  248.       WordWrap        =   -1  'True
  249.    End
  250.    Begin VB.Label Label1 
  251.       AutoSize        =   -1  'True
  252.       Caption         =   "This sample program demonstrates some of the appearance and behaviour options for the Numeric Edit control."
  253.       Height          =   390
  254.       Index           =   0
  255.       Left            =   90
  256.       TabIndex        =   1
  257.       Top             =   90
  258.       Width           =   5490
  259.       WordWrap        =   -1  'True
  260.    End
  261. Attribute VB_Name = "Form1"
  262. Attribute VB_GlobalNameSpace = False
  263. Attribute VB_Creatable = False
  264. Attribute VB_PredeclaredId = True
  265. Attribute VB_Exposed = False
  266. Private Sub Command1_Click()
  267.     Unload Me
  268. End Sub
  269. Private Sub Data1_Reposition()
  270.     NumericEdit1.Estimated = Data1.Recordset.Fields("Estimate1").Value
  271.     NumericEdit2.Estimated = Data1.Recordset.Fields("Estimate2").Value
  272.     NumericEdit3.Estimated = Data1.Recordset.Fields("Estimate3").Value
  273.     NumericEdit4.Estimated = Data1.Recordset.Fields("Estimate4").Value
  274. End Sub
  275. Private Sub Data1_Validate(Action As Integer, Save As Integer)
  276.         
  277.     Data1.UpdateRecord 'commit changes before starting edit
  278.         
  279.     Data1.Recordset.Edit
  280.     Data1.Recordset.Fields("Estimate1").Value = NumericEdit1.Estimated
  281.     Data1.Recordset.Fields("Estimate2").Value = NumericEdit2.Estimated
  282.     Data1.Recordset.Fields("Estimate3").Value = NumericEdit3.Estimated
  283.     Data1.Recordset.Fields("Estimate4").Value = NumericEdit4.Estimated
  284.     Data1.Recordset.Update
  285. End Sub
  286.